<template>
	<view class="team">
		<view v-if="myTeam">
			<view  v-for="(item,index) in myTeam " :key="index">
				<view class="team-item" v-for="(items,indexs) in item.user_info " :key="indexs">
					<image class="photo" :src="items.photo_url" mode=""></image>
					<view class="name">
						<view>{{items.nickname}}</view>
						<!-- <view class="level" v-if="item.level==2">二级分销商</view>
						<view class="level"  v-if="item.level==3">三级分销商</view> -->

					</view>
					<view class="time">{{items.join_time}}</view>
				</view>
			</view>
		</view>
		<view class="undata" v-else>
			<text class="none">没有更多数据了~</text>
		</view>
	</view>
</template>

<script>
	import { mapState, mapGetters, mapMutations, mapActions } from 'vuex';
	import navBar from '@/pages/components/navBar/index.vue'
	export default{
		data(){
			return{
				myTeam:''
			}
		},
		onShow(){
			this.getMyTeam();
		},
		methods:{
			async getMyTeam(){
				let userToken=uni.getStorageSync('userToken');
				if(userToken){
					let res=await this.$api.getMyTeam({
						user_token:userToken
					})
					if(res.data.level=='success'){
						this.myTeam=res.data.data
					}
				}
				
			}
		}
	}
</script>

<style scoped lang="scss">
	.team{
		padding: 20rpx;
		font-size: 30rpx;
	}
	.team-item{
		display: flex;
		flex-direction: row;
		padding-bottom: 30rpx;
		justify-content: center;
		align-items: center;
		.name{
			width: 50%;
			padding-left: 20rpx;
		}
		.photo{
			width: 56rpx;
			height: 56rpx;
			border-radius: 50%;
		}
		.level{
			color: deepskyblue;
		}
	}
	.undata{
		text-align: center;
		color: #ccc;
	}
	.none{
		padding: 30rpx;
	}
</style>
